package win.doyto.service.data.config;

import lombok.Getter;
import lombok.Setter;

import java.util.Set;

/**
 * ReportParam
 *
 * @author f0rb on 2020-05-05
 */
@Getter
@Setter
@SuppressWarnings("unused")
public class ReportParam {
    String csvColSeparator = ";";
    String csvCharset = "UTF-8";
    String xlsSheetName;
    String jsonPropertyName;
    boolean singleValue;
    boolean singleRow;
    Set<String> supportedContentTypes;

    public void setIsSingleValue(boolean singleValue) {
        this.singleValue = singleValue;
    }

    public void setIsSingleRow(boolean singleRow) {
        this.singleRow = singleRow;
    }

    public boolean isContentTypeSupported(String contentType) {
        return supportedContentTypes != null &&
                (supportedContentTypes.contains("*") || supportedContentTypes.contains(contentType));
    }
}
